﻿<%@ Page Language="C#" MasterPageFile="~/Layouts/List.Master" AutoEventWireup="true"
    Inherits="MallNavi.UI.Modules.TodoTaskMag.DoneTaskInfoList" Title="代办任务列表" CodeBehind="DoneTaskInfoList.aspx.cs" %>

<asp:Content ContentPlaceHolderID="head" ID="idFormTitle" runat="server">
    <!-- title -->
</asp:Content>

<asp:Content ID="idContent" ContentPlaceHolderID="Content" runat="Server">   
    <!-- 搜索框 -->
    <div class="search" style="margin-top:2px;">     
        <web:search ID="GridSearch" GridViewId="SmartGridView1" runat="server">            
            <SearchConditionTemplate>                                       
                <table cellpadding="0" cellspacing="0" width="95%">
                  <tr>
						<th>
							任务标题：
						</th>
						<td>
							<asp:TextBox ID="tbTaskName" Name="TaskName" runat="server"  Width="155px" ></asp:TextBox>
						</td>  
                        <th>
							创建人：
						</th>
						<td>
							<asp:TextBox ID="tbCreatorName" Name="CreatorName" runat="server"  Width="155px" ></asp:TextBox>
						</td>                                       
						<th>
							任务类型：
						</th>
						<td>
                            <web:SmartDropDownList ID="ddlWorkflowId" Name="WorkflowId" runat="server" CommandName="SELECT Name,WorkflowId FROM dbo.WorkflowDefinition"  Width="160px" />
						</td>                                     
				    </tr>
                </table>
            </SearchConditionTemplate>                      
        </web:search>
    </div>

    <div class="datalist">
        <!-- 标题头 -->
        <h2 style="height:30px;">已办任务列表</h2>
        <!-- 工具栏 -->
        <div class="toolbar"  style="height:30px;">
            <asp:LinkButton ID="lbtnRefresh" runat="server" OnClick="SearchGrid" style="display:none;">刷新</asp:LinkButton>
        </div>
        <div class="datagrid"  style="clear:left;">    
            <!--------------------------- List Area --------------------------->
            <web:SmartGridView ID="SmartGridView1" runat="server" AutoGenerateColumns="False"
                Width="100%" DataKeyNames="InstanceId,TaskID" DataSourceID="SmartDataSource1" PageSize="10">
                <Columns>   
                    <asp:BoundField DataField="InstanceId" HeaderText="流程编号" SortExpression="InstanceId" ItemStyle-HorizontalAlign = "Center"  />
                    <asp:TemplateField HeaderText="标题" SortExpression="Tile" ItemStyle-HorizontalAlign = "Left">
                        <ItemTemplate>
                            <a href="javascript:void(0)" onclick="showTaskInfo(this);" title="点击打开任务明细" instanceId='<%#Eval("InstanceId") %>' taskId='<%#Eval("TaskId") %>'><%#Eval("Title")%></a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="CreatorName" HeaderText="创建人" SortExpression="CreatorName" ItemStyle-HorizontalAlign = "Center"  />
                    <asp:BoundField DataField="CreateTime" HeaderText="创建时间" SortExpression="CreateTime" DataFormatString="{0:yyyy-MM-dd HH:mm}" ItemStyle-HorizontalAlign = "Center"  />
                    <asp:BoundField DataField="ReadTime" HeaderText="阅读时间" SortExpression="ReadTime" DataFormatString="{0:yyyy-MM-dd HH:mm}" ItemStyle-HorizontalAlign = "Center"  />
                    <asp:BoundField DataField="PartName" HeaderText="处理人" SortExpression="PartName" ItemStyle-HorizontalAlign = "Center"  />
                    <asp:BoundField DataField="FinishTime" HeaderText="处理时间" SortExpression="FinishTime" DataFormatString="{0:yyyy-MM-dd HH:mm}" ItemStyle-HorizontalAlign = "Center"  />
                </Columns>
                <PagerSettings />
                <EditRowStyle HorizontalAlign="Center" />
            </web:SmartGridView>
            <web:SmartSqlDataSource ID="SmartDataSource1" runat="server" SelectCommand="TodoTaskMag.DoneTaskInfo.List" SelectCountCommand="TodoTaskMag.DoneTaskInfo.List.Count"
                    DefaultSortExpression="FinishTime DESC" SelectCommandAutoPageWrap="true">
            </web:SmartSqlDataSource>
        </div>
    </div>

    <script type="text/javascript">
        function showTaskInfo(sender) {
            //异步更新任务为已读
            var param = {
                instanceId: $(sender).attr("instanceId"),
                taskId: $(sender).attr("taskId"),
                actionType: 2
            }

            //打开处理页面
            var url = "/Modules/Workflow/WorkItem.aspx"
            window.open(Global.contextPath + buildUrl(url, param));
        }
    </script>

</asp:Content>